package com.itheima.dao;

import com.itheima.pojo.OrderSetting;
import org.apache.ibatis.annotations.Insert;
import org.apache.ibatis.annotations.Select;
import org.apache.ibatis.annotations.Update;

import java.util.Date;
import java.util.HashMap;
import java.util.List;

public interface OrderSettingDao_scg {

    @Select("select count(*) from t_ordersetting where orderDate = #{orderDate}")
    Long findCountByOrderDate(Date orderDate);

    @Update("update t_ordersetting set number = #{number} where orderDate = #{orderDate}")
    void editNumberByOrderDate(OrderSetting orderSetting);

    @Insert("insert into t_ordersetting (orderDate,number,reservations) values (#{orderDate},#{number},#{reservations})")
    void add(OrderSetting orderSetting);

    @Select("select * from t_ordersetting where orderDate between #{dateBegin} and #{dateEnd}")
    List<OrderSetting> getOrderSettingByMonth(HashMap<Object, Object> map);

    @Select("select * from t_ordersetting where orderDate = #{date}")
    OrderSetting findByOrderDate(Date date);

    @Update("update t_ordersetting set reservations = #{reservations} where orderDate = #{orderDate}")
    void editReservationsByOrderDate(OrderSetting orderSetting);


    void deleteByDate(Date date);
}
